﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using B2B.Business;
using WeiDuan.Model;

namespace B2B.Service
{
    public interface IProductService
    {
        //Product

        /// <summary>
        /// 根据商品类别ID查询所有属性以及属性的可选值
        /// </summary>
        /// <param name="id"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        List<ClassAttrAndOptionsInfo> QueryClassAttrByClass(string id, UserInfo user);

        List<ClassAttrGroupInfo> QueryClassAttrGroupByClass(string id, UserInfo user);

        /// <summary>
        /// 添加一个新商品
        /// </summary>
        /// <param name="req"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        string AddProduct(ProductAddRequest req, UserInfo user);


        /// <summary>
        /// SKU批量添加
        /// </summary>
        /// <param name="req"></param>
        /// <param name="user"></param>
        void AddProductSKU(List<ProductSKUAddRequest> req, UserInfo user);
        string AddCarPartsByExcel(List<ProductSKUInputByCarPartsRequest> req, UserInfo user);

        /// <summary>
        /// 修改一个商品
        /// </summary>
        /// <param name="req"></param>
        /// <param name="user"></param>
        void UpdateProduct(ProductUpdateRequest req, UserInfo user);

        /// <summary>
        /// 删除一个商品
        /// </summary>
        /// <param name="id"></param>
        /// <param name="user"></param>
        void RemoveProduct(string id, UserInfo user);

        /// <summary>
        /// 根据商品类别查询商品目录
        /// </summary>
        /// <param name="id"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        List<ProductInfo> QueryProductByClass(string id, UserInfo user);

        /// <summary>
        /// 根据商品类别查询商品目录
        /// </summary>
        /// <param name="id"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        QueryResult<List<ProductInfo>> QueryProductByClass(PageQueryRequest<String> req, UserInfo user);

        //ProductSKU
        
        /// <summary>
        /// 重建SKU
        /// </summary>
        /// <param name="productId"></param>
        /// <param name="user"></param>
        void ReBuildSKU(string productId, UserInfo user);

        /// <summary>
        /// 查询商品SKU
        /// </summary>
        /// <param name="req"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        List<ProductSKUInfo> QueryProductSKU(ProductSKUQueryRequest req, UserInfo user);

        List<ProductPackSKUInfo> QueryProductPackByClassID(ProductPackQueryRequest req, UserInfo user);

        /// <summary>
        /// 获取商品SKU的查询参数
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        List<QueryArg> GetProductSKUQueryArgs(UserInfo user);

        //ProductPack

        /// <summary>
        /// 添加一个打包品
        /// </summary>
        /// <param name="req"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        string AddProductPack(ProductPackAddRequest req, UserInfo user);

        /// <summary>
        /// 修改一个打包品
        /// </summary>
        /// <param name="req"></param>
        /// <param name="user"></param>
        void UpdateProductPack(ProductPackUpdateRequest req, UserInfo user);

        void UpdateProductPackPrice(ProductPackPriceUpdateRequest req, UserInfo user);

        /// <summary>
        /// 销售方确认报价
        /// </summary>
        /// <param name="id"></param>
        /// <param name="user"></param>
        void SalerAudit(ProductPackAuditRequest req, UserInfo user);

        /// <summary>
        /// 采购方确认报价
        /// </summary>
        /// <param name="id"></param>
        /// <param name="user"></param>
        void BuyerAudit(ProductPackAuditRequest req, UserInfo user);

        /// <summary>
        /// 添加一个Buyer
        /// </summary>
        /// <param name="req"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        string AddBuyer(BuyerAddRequest req, UserInfo user);

        void UpdateBuyer(BuyerUpdateRequest req, UserInfo user);
        
        /// <summary>
        /// 客户认证
        /// </summary>
        /// <param name="req"></param>
        /// <param name="user"></param>
        void AuthBuyer(BuyerAuthRequest req, UserInfo user);

        List<BuyerInfo> QueryBuyer(BuyerQueryRequest req, UserInfo user);

        EnumValue[] GetSaleType();

        void RemoveBuyer(string id, UserInfo user);

        /// <summary>
        /// 适用车型查询
        /// </summary>
        /// <param name="id"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        List<CarModelInfo> QueryCarModelBySerialId(string id, UserInfo user);
        
        /// <summary>
        /// 查询指定属性下的所有值
        /// </summary>
        /// <param name="attrId"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        List<ProductAttributeValueInfo> QueryAttributeValue(string attrId, UserInfo user);

        /// <summary>
        /// 查询适用车型属性下的所有值
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        List<ProductAttributeValueInfo> QueryAttributeValueByCarUser(UserInfo user);
    }
}
